package com.xw.p03_SingletonPattern;

/**
 * @author XW
 * @data 2023/12/4 14:54
 * @description 皇帝
 *   懒汉模式
 */
public class LazyEmperor {

    private final static LazyEmperor lazyEmperor = new LazyEmperor();

    private LazyEmperor(){}

    public static LazyEmperor getInstance() {
        return lazyEmperor;
    }

    //皇帝叫什么名字呀
    public  void emperorInfo(){
        System.out.println("我就是皇帝"+lazyEmperor.hashCode());
    }
}
